package com.example.webupload.common;

/**
 * 常量类
 */
public class Constants {

    /**
     * 文件状态
     */
    public static class FileStatus {
        /**
         * 无效
         */
        public static final int INVALID = 0;

        /**
         * 有效
         */
        public static final int VALID = 1;
    }

    /**
     * 上传状态
     */
    public static class UploadStatus {
        /**
         * 失败
         */
        public static final int FAILED = 0;

        /**
         * 成功
         */
        public static final int SUCCESS = 1;
    }

    /**
     * 文件类型
     */
    public static class FileType {
        /**
         * 图片
         */
        public static final String IMAGE = "image";

        /**
         * 文档
         */
        public static final String DOCUMENT = "document";

        /**
         * 视频
         */
        public static final String VIDEO = "video";

        /**
         * 音频
         */
        public static final String AUDIO = "audio";

        /**
         * 压缩文件
         */
        public static final String ARCHIVE = "archive";

        /**
         * 其他
         */
        public static final String OTHER = "other";
    }

    /**
     * 文件扩展名映射
     */
    public static class FileExtMapping {
        /**
         * 图片
         */
        public static final String[] IMAGE = {"jpg", "jpeg", "png", "gif", "bmp", "webp"};

        /**
         * 文档
         */
        public static final String[] DOCUMENT = {"doc", "docx", "xls", "xlsx", "ppt", "pptx", "pdf", "txt"};

        /**
         * 视频
         */
        public static final String[] VIDEO = {"mp4", "avi", "rmvb", "mov", "wmv", "flv"};

        /**
         * 音频
         */
        public static final String[] AUDIO = {"mp3", "wav", "wma", "ogg", "aac"};

        /**
         * 压缩文件
         */
        public static final String[] ARCHIVE = {"zip", "rar", "7z", "tar", "gz"};
    }
}